package com.maxatime.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.maxatime.dao.CodeMapper;
import com.maxatime.pojo.entity.Code;
import com.maxatime.service.CodeService;
import com.maxatime.util.MyContent;


@Service
public class CodeServiceImpl implements CodeService{

	
	@Autowired
	CodeMapper codeMapper;
	
	
	@Override
	public int insertSelective(Code record) {
		// TODO Auto-generated method stub
		codeMapper.deleteByPrimaryKey(record);
		codeMapper.insertSelective(record);
		
		
		return 0;
	}


	@Override
	public Map<String, Object> cha(Code record) {
		// TODO Auto-generated method stub
		Map<String, Object> m = new HashMap<>();
		
		Code code=codeMapper.cha(record);
		if(code!=null) {
			m.put(MyContent.MSG, "验证成功");
			m.put(MyContent.CODE, "1111");
		}
		
		
		
		return m;
	}

}
